using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Resources;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using KPIS.GERP.Models.Class;

namespace KPIS.GERP.Models.ICM
{
    using System;
    using System.Collections.Generic;
    
	[DataContract, Table("IcmAssetWarranty")]
    public class AssetWarranty
    {
        public AssetWarranty()
        {
            RecordStatus = "U";
        }

		[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
		[DataMember, Display(Name = "WarrantyId", ResourceType = typeof(Resources.AssetWarrantyResource))]
        public int WarrantyId { get; set; }

        [ForeignKey("Asset")]
        [DataMember, Display(Name = "AssetId", ResourceType = typeof(Resources.AssetWarrantyResource))]
        public int AssetId { get; set; }

        [CustomRequired]
        [StringLength(50)]
        [DataMember, Display(Name = "WarrantyNo", ResourceType = typeof(Resources.AssetWarrantyResource))]
        public string WarrantyNo { get; set; }

        [CustomRequired]
        [DisplayFormat(DataFormatString = "{0:N4}")]
        [DataMember, Display(Name = "WarrantyPrice", ResourceType = typeof(Resources.AssetWarrantyResource))]
        public decimal? WarrantyPrice { get; set; }

        [CustomRequired]
        [DataMember, Display(Name = "WarrantyTime", ResourceType = typeof(Resources.AssetWarrantyResource))]
        public int? WarrantyTime { get; set; }

        [CustomRequired]
        [DataMember, Display(Name = "WarrantyStartDate", ResourceType = typeof(Resources.AssetWarrantyResource))]
        public DateTime? WarrantyStartDate { get; set; }

        [CustomRequired]
        [DataMember, Display(Name = "WarrantyExpireDate", ResourceType = typeof(Resources.AssetWarrantyResource))]
        public DateTime? WarrantyExpireDate { get; set; }

        [StringLength(255)]
        [DataMember, Display(Name = "Description", ResourceType = typeof(Resources.AssetWarrantyResource))]
        public string Description { get; set; }

        [DataMember, Display(Name = "Remark", ResourceType = typeof(Resources.AssetWarrantyResource))]
        public string Remark { get; set; }
        
        [StringLength(2)]
        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(Resources.AssetWarrantyResource))]
        public string RecordStatus { get; set; }
        
        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(Resources.AssetWarrantyResource))]
        public int CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(Resources.AssetWarrantyResource))]
        public DateTime? CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(Resources.AssetWarrantyResource))]
        public int? UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(Resources.AssetWarrantyResource))]
        public DateTime? UpdatedWhen { get; set; }

        [DataMember]
        public virtual Asset Asset { get; set; }
    }
}